package H4102;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import javax.swing.Timer;

import org.w3c.dom.Element;

import sourceCode.Aeroport;
import sourceCode.Chariot;

import sourceCode.Guichet;

import sourceCode.Rail;

import sourceCode.Tobogan;

import sourceCode.Aeroport;

import sourceCode.Embranchement;

import vues.Vue;
import vues.VueAeroport;
import vues.VueChariot;
import vues.VueEmbranchement;
import vues.VueGuichet;
import vues.VueRail;
import vues.VueTobogan;


/*Cette classe est le panel contenant la carte de la simulation*/

public class CartePanel extends JPanel implements ActionListener {
    
    private VueAeroport vueAeroport;
    private Aeroport aeroport;
    public CartePanel() {
        super();
    }
    
    public void SetAeroport(Aeroport a) {
        if (this.aeroport == null)
            this.aeroport = a;
    }
    
    public VueAeroport GetVueAeroport() {
        return this.vueAeroport;
    }
    
    public void Redessiner() {
        Graphics g = getGraphics();
        if (g != null) {
            update(g);
        }
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        
        if (this.vueAeroport != null)
            this.vueAeroport.dessiner(g);
    }
    
    public int ConstruireCarteAPartirDeDOMXML(Element vueCadreDOMElement) {
        return 0;
    }
    
    public void actionPerformed (ActionEvent e) {
    }

    public void setVueAeroport(VueAeroport vueAeroport) {
        this.vueAeroport = vueAeroport;
    }
}
